$("#back").click(function (e) { 
    $("iframe").css("-webkit-animation","close 1s forwards");
    $("#head-title").text("首页");
    $("#back").hide();
    $("#head").css("color","rgba(233, 233, 233, 0.589)");
    $("#head").css("background-color","rgba(150, 150, 150, 0");
});

$("input").click(function(e){
    var href = $(this).attr("title");
    if(href == "") return;
    $("iframe").css("display","block");
    $("iframe").css("-webkit-animation","open 1s");
    $("iframe").attr("src","./" + href + "/index.html");
    $("#back").show();
    $("#head-title").text($(this).attr("value"));
    $("#head").css("color","rgba(233, 233, 233, 1)");
    $("#head").css("background-color","rgba(51, 51, 51, 0.815)");
});

var position = 0;
var scrolling = false;
$(window).scroll(function () {
    if(scrolling) return;
    var scroll = $(this).scrollTop();
    console.log($(this).scrollTop());
    if(scroll > 5 && scroll < 100){
        scrolling = true;
        $("html, body").animate({
            scrollTop: $(this).height()
        }, 1000,function(){
            scrolling =false;
        });
    }else if(scroll < $(this).height() - 10 && scroll > $(this).height() - 100){
        scrolling = true;
        $("html, body").animate({
            scrollTop: 0
        }, 1000,function(){
            scrolling =false;
        });
    }
});